<?php
/*********************************************
  Dragonfly CMS, Copyright (c) 2004 by CPGNuke Dev Team
  http://dragonflycms.org
  Released under GNU GPL version 2 or any later version
**********************************************/

abstract class Dragonfly_Output_Xhtml
{
	final public static function minify($str)
	{
		if (DF_MODE_DEVELOPER) return $str;
		$str = preg_replace('#\R+#',  "\n", $str);
		$str = preg_replace('#\n\s+#',"\n", $str);
		$str = preg_replace('#\s+\n#',"\n", $str);
		return preg_replace('#\s+(/?>)#','$1', $str);
	}
}
